package javaTodotxt;

import java.io.IOException;
import javaTodotxt.TodotxtInterpreter;
import java.io.*;

public class Todotxt {
	
	private static TodotxtInterpreter interpreter = null;
	private static InputStreamReader converter = new InputStreamReader(System.in);
	private static BufferedReader in = new BufferedReader(converter);
	
	public static void main(String[] args) {
		
		
		try{
			if (args.length > 0){
				interpreter = new TodotxtInterpreter(args[0]);
			}else{
				interpreter = new TodotxtInterpreter();
			}
			System.out.print(">");
			while (interpreter.interpret(in.readLine())){
				System.out.print(">");				
			}
		} catch (IOException e) {
            System.err.println("Caught IOException: "
                    + e.getMessage());
        } catch (Exception e) {
            System.err.println(e.getMessage());
        } 
		
	}
	

}